package com.example.webapi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.webapi.Utils.ResponseModel;
import com.example.webapi.entity.Listdata;
import com.example.webapi.mapper.ListdataMapper;
import com.example.webapi.service.ListdataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 表格数据 服务实现类
 * </p>
 *
 * @author  张彬 
 * @since 2021-10-27
 */
@Service
public class ListdataServiceImpl extends ServiceImpl<ListdataMapper, Listdata> implements ListdataService {
    @Resource
    ListdataMapper listdataMapper;

    public ResponseModel getTableData(Integer typeId){
        QueryWrapper<Listdata> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("buildingHeight", "buildingWidth").eq("typeID",typeId);


        return ResponseModel.success(listdataMapper.selectMaps(queryWrapper));
    }
}
